<template>
  <div>
    <h3>MyContacts</h3>

    <router-link to="/mycontacts/all_contacts">All_contacts</router-link>&emsp;
    <router-link to="/mycontacts/myalice">MyAlice</router-link>&emsp;
    <router-link to="/mycontacts/mybob">MyBob</router-link>&emsp;
    <button @click="fn">随机显示</button>
    <hr />
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: "MyContacts",
  components: {},
  props: {},
  data() {
    return {
      list: [
        "/mycontacts/all_contacts",
        "/mycontacts/myalice",
        "/mycontacts/mybob",
      ],
    };
  },
  computed: {},
  watch: {},
  created() {},
  methods: {
    fn() {
      const random = Math.floor(Math.random() * 3);
      this.$router.push(this.list[random]);
    },
  },
};
</script>

<style scoped></style>
